using System;

namespace DnsService.Models
{
    /// <summary>
    /// DNS测试结果模型
    /// 作者：huobing
    /// </summary>
    public class DnsTestResult
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public DnsTestResult()
        {
            TestTime = DateTime.Now;
        }
        
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="isSuccess">是否成功</param>
        public DnsTestResult(bool isSuccess)
        {
            IsSuccess = isSuccess;
            TestTime = DateTime.Now;
        }
        
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool IsSuccess { get; set; }
        
        /// <summary>
        /// 响应时间（毫秒）
        /// </summary>
        public long ResponseTimeMs { get; set; }
        
        /// <summary>
        /// 解析的IP地址
        /// </summary>
        public string? ResolvedIp { get; set; }
        
        /// <summary>
        /// 错误消息
        /// </summary>
        public string? ErrorMessage { get; set; }
        
        /// <summary>
        /// 测试时间
        /// </summary>
        public DateTime TestTime { get; set; } = DateTime.Now;
    }
}